import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class OrderBean implements Writable {

    private String oid;
    private Double amount;

    public OrderBean(String oid, Double amount) {
        this.oid = oid;
        this.amount = amount;
    }

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeDouble(this.amount);
        out.writeUTF(this.oid);

    }

    @Override
    public void readFields(DataInput in) throws IOException {
        this.amount = in.readDouble();
        this.oid = in.readUTF();


    }
}
